<div class="row">	<div class="span8 offset2">
		<?php		if (validation_errors() != "") {			$error_output = "";			$error_output = "<div class='alert alert-error'>";			$error_output .= "<button class='close' data-dismiss='alert'>×</button>";			$error_output .= '<h4 class="alert-heading">Form Errors</h4>';			$error_output .= validation_errors('<p class="error">');			$error_output .= "</div>";			echo $error_output;		}		?>		<?php
		$attributes['class'] = "well form-horizontal post-form";
		$hidden = array('author_id' => $this -> session -> userdata('user_id'));
		
		if ($post -> getFile() != "") {
			$hidden['file'] = $post -> getFile();
		}		
		echo form_open_multipart((isset($id)) ? "post/edit/".$id : "post/create",$attributes,$hidden);
		echo "<legend>";		echo (isset($id)) ? 'Update Post' : 'Create Post';		echo "</legend>";
		echo "<div class='control-group'>";		echo form_label('Post title', 'title', array("class" => "control-label"));		echo "<div class='controls'>";
		echo form_input('title', set_value('title',$post->getTitle()) ? $post->getTitle() : '' );
		echo "</div>";		echo "</div>";
		echo "<div class='control-group'>";		echo form_label('Post title clean', 'title_clean', array("class" => "control-label"));		echo "<div class='controls'>";		echo form_input('title_clean', set_value('title_clean', $post->getTitleClean() ? $post->getTitleClean() : ''));		echo "</div>";		echo "</div>";		if(count($categories)>0)
		{
		echo "<div class='control-group'>";		echo form_label('Category', 'category_id', array("class" => "control-label"));		echo "<div class='controls'>";		echo form_dropdown('category_id', $categories,$post->getCategory() ? $post->getCategory()->getId() : '' );
		echo "</div>";
		echo "</div>";
		}
		else{
		echo "please add a category first";
		}				echo "<div class='control-group'>";		echo form_label('Short Description', 'short_description', array("class" => "control-label","id" => "short_description"));		echo "<div class='controls'>";				echo form_textarea('short_description', set_value('short_description',$post->getShortDescription() ? $post->getShortDescription() : '' ));		echo "</div>";		echo "</div>";
		echo "<div class='control-group'>";		echo form_label('Body Text', 'article', array("class" => "control-label"));		echo "<div class='controls'>";				echo form_textarea('article', set_value('article',$post->getArticle() ? $post->getArticle() : '' ));
		echo "</div>";
		echo "</div>";
		echo "<div class='control-group'>";		echo form_label('File', 'file', array("class" => "control-label"));		echo "<div class='controls'>";
		echo form_upload('file');
		echo "</div>";
		echo "</div>";
		echo "<div class='control-group'>";		echo form_label('Featured', 'featured', array("class" => "control-label"));		echo "<div class='controls'>";
		echo form_checkbox('featured', '', ($post->isFeatured() && $post->isFeatured()==1 ) ? (boolean) $post->isFeatured() : '' );
		echo "</div>";
		echo "</div>";
		echo "<div class='control-group'>";		echo form_label('Enabled', 'enabled', array("class" => "control-label"));		echo "<div class='controls'>";
		echo form_checkbox('enabled', '', ($post->isEnabled() && $post->isEnabled()==1 ) ? (boolean)$post->isEnabled() : '' );
		echo "</div>";
		echo "</div>";
		echo "<div class='control-group'>";		echo form_label('Comments Enabled?', 'comments_enabled', array("class" => "control-label"));		echo "<div class='controls'>";
		echo form_checkbox('comments_enabled', '', ($post->areCommentsEnabled() && $post->areCommentsEnabled() == 1 ) ? (boolean) $post->areCommentsEnabled()  : '' );
		echo "</div>";
		echo "</div>";		?>
		<div class="form-actions">			<button type="submit" class="btn btn-primary">				<?php echo (isset($id)) ? 'Update Post' : 'Create Post'				?>			</button>			<button type="reset" class="btn">				Cancel			</button>		</div>
		<?php
		echo form_fieldset_close();		?>	</div></div>